package hk.ust.cse.comp3111.studentSchedule;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.Toast;
import android.widget.CalendarView.OnDateChangeListener;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.widget.CalendarView;
import android.view.View.OnClickListener;
import android.widget.Button;

public class ViewCalendar extends Fragment {
	
	public ViewCalendar(){}
	
	@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
 
        View rootView = inflater.inflate(R.layout.calendar, container, false);
         
        return rootView;
    }
	
	static final int PICK_DATE_REQUEST = 1;
	
	public void onStart() {
		super.onStart();
		CalendarView c=(CalendarView) getActivity().findViewById(R.id.calendarView1);
		c.setOnDateChangeListener(new CalendarView.OnDateChangeListener() {

	public void onSelectedDayChange(CalendarView arg0, int year, int month, int date) {
		Toast.makeText(getActivity().getApplicationContext(), date + "/" + (month+1) + "/" + year, 4000).show();
	}

		});
	}
}
